<template>
	<view>
		<view v-for="(item,index) in integralList" :key="index" class="item_box">
			<view class="left">
				<text class="title">{{item.title}}</text>
				<text class="date">{{item.date}}</text>
			</view>
			<view class="right" :class="item.state == 0 ? 'color-red' : ''">
				{{item.state == 0 ? '+' : '-'}}{{item.value}}
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				integralList: [
					{
						id: 0,
						state: 0,
						value: 10,
						title: '签到',
						date: '2020-11-2 13:11'
					},
					{
						id: 1,
						state: 0,
						value: 10,
						title: '签到',
						date: '2020-11-2 13:11'
					},
					{
						id: 2,
						state: 1,
						value: 10,
						title: '兑换转盘次数',
						date: '2020-11-2 13:11'
					},
					{
						id: 3,
						state: 0,
						value: 10,
						title: '签到',
						date: '2020-11-2 13:11'
					},
				]
			};
		}
	}
</script>

<style lang="scss">
	.item_box {
		padding: 20upx 30upx 30upx 30upx;
		box-shadow: 0px 4px 10upx 0px rgba(4, 0, 0, 0.1);
		border-radius: 10upx;
		margin-bottom: 30upx;
		display: flex;
		align-items: center;
		justify-content: space-between;
		.left {
			display: flex;
			flex-direction: column;
			.title {
				font-size: 30upx;
				margin-bottom: 20upx;
			}
			.date {
				font-size: 24upx;
				color: $color-999;
			}
		}
		.right {
			font-weight: bold;
			font-size: 30upx;
		}
		.color-red {
			color: $red;
		}
	}
</style>

<style>
	page {
		padding: 30upx;
	}
</style>